{template 'common/header'}
<ul class="nav nav-tabs">
	<li {if $op == 'add'}class="active"{/if}><a href="{php echo $this->createWebUrl('category', array('op' => 'add'))}">添加分类</a></li>
	<li {if $op == 'list'}class="active"{/if}><a href="{php echo $this->createWebUrl('category', array('op' => 'list'))}">管理分类</a></li>
</ul>
<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" onsubmit="return check(this);">
	<input type="hidden" name="parentid" value="{$parentid}" />
	<div class="panel panel-default">
	  <div class="panel-heading">
	    <h3 class="panel-title">分类详细设置</h3>
	  </div>
	  <div class="panel-body">
	  		{if !empty($parentid)}
	    	<div class="form-group">
			    <label for="" class="col-sm-2 control-label">上级分类</label>
			    <div class="col-xs-2">
			      {$parent['name']}
			    </div>
			</div>
			{/if}
			<div class="form-group">
			    <label for="displayorder" class="col-sm-2 control-label">排序</label>
			    <div class="col-xs-2">
			      <input type="text" name="displayorder" id='displayorder' class="form-control" value="{$category['displayorder']}" placeholder="排序"/>
			    </div>
			</div>
			<div class="form-group">
			    <label for="catename" class="col-sm-2 control-label">分类名称</label>
			    <div class="col-xs-2">
			      <input type="text" name="catename" class="form-control" value="{$category['name']}" id='catename' placeholder="分类名称"/>
			    </div>
			</div>
			<div class="form-group">
			    <label for="description" class="col-sm-2 control-label">分类描述</label>
			    <div class="col-xs-4">
			      <textarea name="description" class="form-control" rows='3' id='description' placeholder="分类描述">{$category['description']}</textarea>
			    </div>
			</div>
			<div class="form-group">
			    <label for="" class="col-sm-2 control-label"></label>
			    <div class="col-sm-10">
			      <input name="submit" type="submit" value="提交" class="btn btn-primary span3">
					<input type="hidden" name="token" value="{$_W['token']}" />
			    </div>
			</div>
	  </div>
	</div>
	</form>
</div>
<script type="text/javascript">
        function check(form){
            if (!form['catename'].value) {
                alert('请输入分类名称。');
                return false;
            }
            if (!form['description'].value) {
                alert('请输入分类描述！');
                return false;
            }
            return true;
        }
</script>

{template 'common/footer'}